libxc: obtain correct length of p2m during core dumping
authorMarkus Gross <gross@univention.de>
Tue, 24 May 2011 14:00:16 +0000 (15:00 +0100)
committerMarkus Gross <gross@univention.de>
Tue, 24 May 2011 14:00:16 +0000 (15:00 +0100)
commit93a9049b6d813c4900c8ae1e49911dbe9d90ed01
tree2079636ac79c061978113e1c46046edbb9c8948d
parent18219eb5586da3ecfb06754a1160fe129e26e987
libxc: obtain correct length of p2m during core dumping

while implementing core dumping functionality for the libxl driver
of libvirt, I discovered an issue with mapping pages of a pv guest.

After dumping the core of a pv guest the domain was not cleared up
properly and some pages were not unmapped. This issue is similar
to the one reported here:
http://lists.xensource.com/archives/html/xen-devel/2011-05/msg01314.html

In xc_domain_dumpcore_via_callback in the file xc_core.c the function
xc_core_arch_map_p2m is called to map P2M_FL_ENTRIES pages to the variable p2m.
But to unmap the pages later, the dinfo->p2m_size has to be set accordingly.
This was not done, instead a variable named p2m_size was set.
This way P2M_FL_ENTRIES was always zero and the pages were left mapped.

[ This change should be considered for backport to relevant trees. ]

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_core.c